<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>


</body>


<script>
    class Student {
        constructor(name, age, sex) {
            this.name = name;
            this.age = age;
            this.sex = sex;
        }
        eat() {
            alert(this.name + '正在吃东西');
        }
    }

    var hxh = new Student('洪潇涵', 20, '男');
    hxh.eat();
</script>



</html>